package com.th.campusmatchbackend.service;



import com.baomidou.mybatisplus.extension.service.IService;
import com.th.campusmatchbackend.model.domain.Team;
import com.th.campusmatchbackend.model.domain.User;
import com.th.campusmatchbackend.model.dto.TeamQuery;
import com.th.campusmatchbackend.model.request.TeamJoinRequest;
import com.th.campusmatchbackend.model.request.TeamQuitRequest;
import com.th.campusmatchbackend.model.request.TeamUpdateRequest;
import com.th.campusmatchbackend.model.vo.TeamUserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author taoha
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2023-12-27 16:34:01
*/
public interface TeamService extends IService<Team> {

    /**
     * 添加队伍
     * @param team
     * @param loginUser
     * @return
     */
    long addTeam(Team team, User loginUser);

    /**
     * 查询队伍
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserVO> listTeams(TeamQuery teamQuery,boolean isAdmin);

    /**
     * 查询我加入的队伍
     * @param teamQue
     * @return
     */
    List<TeamUserVO> listMyJoinTeams(TeamQuery teamQue);

    /**
     * 更新队伍
     * @param teamUpdateRequest
     * @param loginUser
     * @return
     */
    boolean updateTeam(TeamUpdateRequest teamUpdateRequest,User loginUser);

    /**
     * 加入队伍
     * @param teamJoinRequest
     * @param user
     * @return
     */
    boolean joinTeam(TeamJoinRequest teamJoinRequest,User user);

    /**
     * 退出队伍
     * @param teamQuitRequest
     * @param loginUser
     * @return
     */
    boolean quitTeam(TeamQuitRequest teamQuitRequest,User loginUser);

    /**
     * 删除队伍
     * @param id
     * @param loginUser
     * @return
     */
    boolean deleteTeam(long id ,User loginUser);

    /**
     * 获取队伍详细信息（关联成员信息）
     *
     * @param teamQuery
     * @param request
     * @return
     */
    TeamUserVO getTeamInfo(TeamQuery teamQuery, HttpServletRequest request);


    /**
     * 获取我创建的队伍
     * @param teamQuery
     * @return
     */
    List<TeamUserVO> listMyCreate(TeamQuery teamQuery);
}
